
window.setEvent = function (e, f) {
    window[e] = f;
};

window.appendEvent = function (e, f) {
    var preEvent = window[e];
    window[e] = function () {
        if ("function" === typeof preEvent) {
            preEvent();
        }
        f();
    };
};

function change(i) {
    var href = "";
    switch (i) {
        case 1:
            href = "styles/red/red.css";
            break;
        
        case 2:
            href = "styles/green/green.css";
            break;
        
        case 3:
            href = "styles/blue/blue.css";
            break;
    }
    //document.getElementById("style").type = "";
    document.getElementById("style").href = href;
    //document.getElementById("style").type = "text/css";
}

function c(n) {
    if (n < 10) {
        return "0" + n;
    }
    return n;
}

var d = new Date();
alert(d.getFullYear() + "-" + c(d.getMonth() + 1) + "-" + c(d.getDate()) + " " + c(d.getHours()) + ":" + c(d.getMinutes()) + ":" + c(d.getDate()));
